﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>打开LobsterBrowser程序</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link href="/lobsteruiframe/layuiadmin/layui/css/layui.css" rel="stylesheet" />
    <link href="/lobsteruiframe/layuiadmin/style/admin.css" rel="stylesheet" />
    <script src="/lobsteruiframe/layuiadmin/layui/layui.js"></script>
    <script src="/jslib/jquery-3.4.1.min.js"></script>
    <script src="/jslib/lobster.js"></script>
    <style>
        html,
        body {
            position: relative;
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
            background-image: url(/resource/welcome.jpg);
            background-repeat: no-repeat;
            background-size: cover;
        }
    </style>

</head>
<body>
    <div class="layui-fluid">
        <blockquote class="layui-elem-quote layui-text">通过浏览器Web页面打开LobsterBrowser程序，显示WebPlugin页面。如果电脑还没有安装LobsterBrowser程序，<span><a href="https://gitee.com/luyunkeji/lobster-browser" target="_blank">点击此处下载</a></span>。</blockquote>
        <div class="layui-text layui-font-18" style="text-align:left;padding-top:50px;word-break:break-all;"><span id="menutxt">正在打开：LobsterBrowser://?token=XX&page=default#BookController#Test#书籍管理&data= </span><span>【<a id="menuhref" href="LobsterBrowser://?token=XX&page=default#BookController#Test#书籍管理&data=">直接打开</a>】</span></div>

    </div>
</body>
</html>


<script type="text/javascript">
    lobsterlayui.main(['index', 'layer', 'form', 'element', 'table'], {
        data: {
            $layui: null,
            right: null,
            menuId:0,
        },
        pageload: function (right) {
            var self = this;
            self.data.menuId = lobsterlayui.GetUrlParam('menuid') || 0;  

            this.initevent();
        },
        initevent() {
            var self = this;

            if (self.data.menuId == 0) {
                var appid = '3052';
                var token = lobsterlayui.GetSSOToken();
                var softname = 'default';
                var controllername = 'BookDemoController';
                var viewname = 'frmBookManager';
                var title = '书籍管理';
                var data = '';
                var url = 'LobsterBrowser://?appid=' + appid + '&token=' + token + '&page=' + softname + '#' + controllername + '#' + viewname + '#' + title + '&data=' + data;
                $('#menutxt').html('正在打开：' + url);
                $('#menuhref').attr('href', url);
                //$('#menuhref').trigger('click');
                window.open(url,'','');
            } else {
                lobsterlayui.GET('/admin/v1/home/GetMenuObj', { menuId: self.data.menuId }).then(retdata => {
                    var menu = retdata['menu'];
                    var appid = menu.AppId;
                    var token = lobsterlayui.GetSSOToken();
                    var softname = 'default';
                    var controllername = menu.ControllerName;
                    var viewname = menu.ViewName;
                    var title = menu.Name;
                    var data = '';
                    var url = 'LobsterBrowser://?appid=' + appid + '&token=' + token + '&page=' + softname + '#' + controllername + '#' + viewname + '#' + title + '&data=' + data;
                    $('#menutxt').html('正在打开：' + url);
                    $('#menuhref').attr('href', url);
                    //$('#menuhref').trigger('click');
                    window.open(url, '', '');
                })
            }
        }
    })

</script>